local prefab_id = 'fx_webbert_misc'
local assets = {
    Asset('ANIM', 'anim/fx_webbert_flame_flow.zip'),
    Asset('ANIM', 'anim/fx_webbert_burn_spread_ring.zip'),
    Asset('ANIM', 'anim/fx_webbert_firepie.zip'),
    Asset("ANIM", "anim/reticuleaoe.zip"),
    Asset("ANIM", "anim/goat_avatar.zip"),
    
}

local prefabs = {}

local function fn()
    local inst = CreateEntity()

    inst.entity:AddTransform()
    inst.entity:AddAnimState()

    inst.entity:AddNetwork()
    inst.entity:AddSoundEmitter()
    -- MakeInventoryPhysics(inst)

    -- inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh")
    -- inst.AnimState:SetLightOverride(1)
    -- inst.AnimState:SetDeltaTimeMultiplier(0.2)

    -- inst.AnimState:PlayAnimation('idle',true)
    -- inst.AnimState:PushAnimation('idle_loop',true)
    -- inst.AnimState:PlayAnimation('idle',true)

    -- inst.AnimState:PushAnimation('loop',true)

    -- inst.AnimState:SetDeltaTimeMultiplier(.6)

    -- inst.AnimState:SetOrientation(ANIM_ORIENTATION.OnGround)
    -- inst.AnimState:SetOrientation(ANIM_ORIENTATION.Default)
    -- inst.AnimState:SetLayer(LAYER_WORLD_BACKGROUND)
    -- inst.AnimState:SetSortOrder(1)

    -- inst.AnimState:SetMultColour(1,1,1,0.7)

    inst:AddTag("NOCLICK")
    inst:AddTag("NOBLOCK")
    inst:AddTag("FX")

    -- inst.Transform:SetScale(1.5,1.5,1.5)

    if not TheWorld.ismastersim then return inst end

    ---@class ent_fx : ent
    ---@field fn_fx_webbert_misc fun(self,bank:string|'fx_webbert_flame_flow'|'fx_webbert_burn_spread_ring'|'fx_webbert_firepie'|'reticuleaoe'|'goat_avatar', build:string|'fx_webbert_flame_flow'|'fx_webbert_burn_spread_ring'|'fx_webbert_firepie'|'reticuleaoe'|'goat_avatar', anim:string|'idle'|'idle_small', loop:boolean, del_when_done:boolean, scale: number|nil, OnGround: boolean|nil, pt: Vector3|nil)

    ---@cast inst ent_fx

    function inst:fn_fx_webbert_misc(bank,build, anim, loop, del_when_done, scale, OnGround, pt)
        if OnGround then
            inst.AnimState:SetOrientation(ANIM_ORIENTATION.OnGround)
            if scale then
                inst.AnimState:SetScale(scale,scale,scale)
            end
        else
            if scale then
                inst.Transform:SetScale(scale,scale,scale)
            end
        end
        if pt then
            inst.Transform:SetPosition(pt:Get())
        end
        inst.AnimState:SetBank(bank)
        inst.AnimState:SetBuild(build)
        inst.AnimState:PlayAnimation(anim,loop)
        if del_when_done then
            inst:ListenForEvent("animover", inst.Remove)
        end
    end

    inst.persists = false

    -- inst:ListenForEvent("animover", inst.Remove)

    return inst
end

return Prefab(prefab_id, fn, assets, prefabs)
